package org.nch.videoLauncher.presenter;

import org.nch.videoLauncher.view.INavButtonView;
import org.nch.videoLauncher.domain.VideoItem;
import org.nch.videoLauncher.task.VideoItemTask;
import org.nch.videoLauncher.task.ProfileUtil;

/**
 * Created by IntelliJ IDEA.
 * User: bill
 * Date: Nov 18, 2008
 * Time: 1:49:09 PM
 * To change this template use File | Settings | File Templates.
 */
public class NavButtonPresenter {

    private INavButtonView view;
    private MainWindowPresenter mainWindowPresenter;
    private VideoItemTask task;

    public NavButtonPresenter(INavButtonView navButtonView, MainWindowPresenter mwPresenter){
        this.view = navButtonView;
        this.mainWindowPresenter = mwPresenter;
        this.task = new VideoItemTask();        
    }

    public void initialize(){

    }

    public void addEditButtonPressed(){
        mainWindowPresenter.setAddEditVideoView();         
    }

    public void browseVideoButtonPressed(){
        mainWindowPresenter.setBrowseVideoView();
    }

    public void selectFileButtonPressed(){
        mainWindowPresenter.setMainWindowMessageText(" "); 
        if (view.isFileSelected(ProfileUtil.getProfile().getBaseVideoPath())){
            task.playVideoItemFromFile(view.getSelectedFilename());
        }
        mainWindowPresenter.setMainWindowMessageText("Welcome to Video Launcher.  Select one of the buttons to get started.");
    }

    public void profileButtonPressed(){
        mainWindowPresenter.setAddEditProfileView();
    }

    public void historyButtonPressed(){
        mainWindowPresenter.setHistoryView();    
    }

    public void searchButtonPressed(){
        mainWindowPresenter.setSearchView();    
    }

    public void playItem(String filename){

    }

}
